package com.woniuxy;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

//解析加密串
public class paras {
    public static void main(String[] args) {
        String token = "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI5NTI3Iiwic3ViIjoi5byg5LiJIiwiaWF0IjoxNjQ5ODU1Njg0LCJteW1vbmV5Ijo" +
                "zNDU1NDM1MzQsImFhYSI6IueahOaSkuaXpuaSkuaXpiJ9.PzKZVu7uJ-xghQb80urcmBHSLX1ODL79YWx3eDXRYww";
        //signingkey-----签名--具有唯一性
        Claims woniuxy = Jwts.parser().setSigningKey("woniuxy")
                .parseClaimsJws(token).getBody();
        System.out.println(woniuxy.getId());
        System.out.println("主体是哪个用户"+woniuxy.getSubject());
        System.out.println("生成token的时间"+woniuxy.getIssuedAt());
        System.out.println(woniuxy.get("mymoney"));
        System.out.println(woniuxy.get("aaa"));
    }
}
